import Vue from 'vue'
import Vuex from 'vuex'
import createPersistedState from 'vuex-persistedstate'

Vue.use(Vuex)

export default new Vuex.Store({
  state: {
    show:true,
    fontname:"/",
    list:[],
    from:{
      page:1,
      limit:10,
      course_type:0,
      classify_id:0,
      order_by:0,
      attr_val_id:0,
      is_vip:0
    },
    str:1,
    config: '',

    smscodeData:{},     //验证码登录
    adminToken:"",
    user_id:"",

    loginparams:{},       //密码
  },
  mutations: {
    course1(state){
      state.show=false
    },
    course2(state){
      state.show=true
    },
    cut(state,str){
      state.fontname=str
    },
    search(state,str){
      state.from=str
    },
    out(state,str){
      state.str=str
    },
    getsmscode(state,str){
      state.smscodeData=str
    },
    adminToken1(state,str){
      state.adminToken=str
    },
    user(state,str){
      state.user_id=str
    },
    loginparams1(state,str){
      state.loginparams=str
    }
  },
  actions: {
  },
  modules: {
  },
  plugins:[
    createPersistedState({
        storage:window.localStorage
    })
  ]
})
